<!-- !+tabs -->

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="js/react.js"></script>
    <script src="js/browser.min.js"></script>
    <script src="js/react-dom.js"></script>
</head>
<body>
    <div id="example"></div>

    <script type="text/babel">
        var MyInput = React.createClass({
            render:function(){
                return  <div>
                 <label>
                    {this.props.labelName}
                 </label>  
                 <input placeholder={this.props.tips}/>
                </div>
            }
        });
        var MyButton = React.createClass({
            render:function(){
                return <button>
                {this.props.btnName}
                </button>
            }
        });
        var MyForm = React.createClass({
            render:function(){
                return <form>
                  <MyInput labelName="用户名" tips="请输入用户名">
                  </MyInput>
                  <MyInput labelName="密码" 
                  tips="请输入密码">
                  </MyInput>
                  <MyButton btnName="登录">
                  </MyButton>
                  <MyButton btnName="注册">
                  </MyButton>
                </form>
            }
        });

        ReactDOM.render(
            <MyForm></MyForm>,
            document.getElementById('example')
        );
    </script>
</body>
</html>